from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


class HomePage:
    def __init__(self, driver):
        self.driver = driver

    def find_no_more_prompt(self):
        xpath = '//*[@id="layui-layer100002"]/div[3]/a[2]'
        elem = WebDriverWait(self.driver, 10).until(
            EC.presence_of_element_located((By.XPATH, xpath)))
        return elem

    def find_zhuanqu(self):
        xpath = '/html/body/div[3]/div[1]/ul/li[2]/a'
        elem = self.driver.find_element(By.XPATH, xpath)
        return elem
